package idv.long.mcv.control.sub
{
	import idv.long.mcv.model.PhysicProxy;
	
	import org.cove.ape.RectangleParticle;
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;

	public class InitPhysicsEngine extends SimpleCommand
	{
		public function InitPhysicsEngine()
		{
			super();
		}
		
		override public function execute(notification:INotification):void
		{
			var phyProxy:PhysicProxy = PhysicProxy(facade.retrieveProxy(PhysicProxy.NAME));
			
			var p1:RectangleParticle = new RectangleParticle(300, 300, 200, 50, 0, true, 1, 0.3, 0.05);
			phyProxy.engine.addEntity(p1, 0);
			
			/*var p2:RectangleParticle = new RectangleParticle(300, 200, 200, 50, 0, false, 1, 0.3, 0.05);
			phyProxy.engine.addEntity(p2);*/
			
			var p3:RectangleParticle = new RectangleParticle(150, 100, 200, 50, 0, false, 1, 0.3, 0.05);
			phyProxy.engine.addEntity(p3, 1);
			
			phyProxy.engine.start();
		}
	}
}